<!-- recordList.html 2018-03-15 23:32:55-->
#@HplusLayout()
#define cssStyle()
<link href="#(res_path)/hplus/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<link href="#(res_path)/hplus/css/plugins/select2/select2.min.css" rel="stylesheet">
#end
#define content()
<div style="padding:0 10px;height: 100%">
	<div id="AdvanceSearch" style="padding:15px;display: none">
		<form class="form-horizontal" novalidate="novalidate" onsubmit="return bootstrapTableRefresh()">
						<div class="form-group">
				<label class="col-xs-3 control-label">会员：</label>
				<div class="col-xs-8">
<select name="user_id" style="width:100%" class="form-control">
	<option value="">全部</option>
</select>
				</div>
			</div>
	    			<div class="form-group">
				<div class="col-xs-8 col-xs-offset-3">
					<button type="reset" class="btn btn-default">清空</button> 
					<button type="submit" class="btn btn-primary">开始查询</button> 
				</div>
			</div>
		</form>
	</div>
	<div id="toolbar">
	<button onclick="layer.open({area: ['450px', 'auto'],content:$('#AdvanceSearch'),type:1,shade: false,title:'搜索'});" type="button" class="btn btn-outline btn-default"><i class="glyphicon glyphicon-search"></i></button>
	</div>
	<table id="bootstrapTable" data-id-field="id" data-url="recordList" data-sort-name="id" data-sort-order="desc">
		<thead>
			<tr>
				<th data-checkbox="true"></th>
				<th data-formatter="xuhaoFormatter" data-align="center" data-width="70px">序号</th>
				<th data-field="user_id_name" data-align="center">会员</th>
				<th data-field="type_id_cn" data-align="center">积分类型</th>
				<th data-field="score" data-align="center">积分</th>
				<th data-field="remark" data-align="left">备注</th>
				<th data-field="create_time" data-align="center" data-width="150px">创建时间</th>
			</tr>
		</thead>
	</table>
</div>
#end
#define js()
<script src="#(res_path)/hplus/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="#(res_path)/hplus/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

<script src="#(res_path)/hplus/js/plugins/select2/select2.full.min.js"></script>
#end
#define jsFunction()
<script>
	$(function(){
		$("select[name='user_id']").select2({
			placeholder:"请输入用户名或姓名搜索",
			ajax: {url: "#(res_path)/portal/auth/select2LoadUserList",dataType: 'json',delay: 250,
			  data: function (params) {
			  	return {keyword: params.term,portal: "MEMBER"};
				},
				processResults: function (data) {return {results: data}},
				cache: true
			}
		});
	});
	function caozuoFormatter(value,row,index){
		var str = "";
			str = str + "<a href=\"javascript:\" onclick=\"layer.open({area: ['600px', '300px'],content: 'addEditRecord?id="+row.id+"',type: 2,title: '编辑记录'});\">编辑</a>  ";
		
		return str;
	}
</script>
#end